package com.lmx.repoDomain.tmodel;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.katharsis.resource.annotations.JsonApiId;

@MappedSuperclass
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class BaseDataEntity implements Identifiable {

	private Long id;
	private Integer errcode;
	// private String code;
	private Short delStatus; // 删除状态 0 未删除 1 已删除
	private String url;
	private Integer oneToManyFlag; // 是否一对多查询 0否1是

	@JsonApiId
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Transient
	public Integer getErrcode() {
		return errcode;
	}

	public void setErrcode(Integer errcode) {
		this.errcode = errcode;
	}

	@Column(name = "del_status", columnDefinition = "smallint default 0 COMMENT '删除状态'")
	public Short getDelStatus() {
		return delStatus;
	}

	public void setDelStatus(Short delStatus) {
		if (delStatus == null)
			delStatus = 0;
		this.delStatus = delStatus;
	}

	@Transient
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Transient
	public Integer getOneToManyFlag() {
		return oneToManyFlag;
	}

	public void setOneToManyFlag(Integer oneToManyFlag) {
		this.oneToManyFlag = oneToManyFlag;
	}
}
